package l1j.server.server.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ListMapUtil {

	private static final Logger _log = Logger.getLogger(ListMapUtil.class
			.getName());

	public static void clear(final ArrayList<?> list) {
		try {
			if (list != null) {
				list.clear();
			}

		} catch (final Exception e) {
			_log.log(Level.SEVERE, "清空ArrayList發生異常", e);
		}
	}

	public static void clear(List<?> list) {
		try {
			if (list != null) {
				list.clear();
			}

		} catch (final Exception e) {
			_log.log(Level.SEVERE, "清空List發生異常", e);
		}
	}

	public static void clear(final Map<?, ?> map) {
		try {
			if (map != null) {
				map.clear();
			}

		} catch (final Exception e) {
			_log.log(Level.SEVERE, "清空Map發生異常", e);
		}
	}

	public static void clear(final Queue<?> queue) {
		try {
			if (queue != null) {
				queue.clear();
			}

		} catch (final Exception e) {
			_log.log(Level.SEVERE, "清空Queue發生異常", e);
		}
	}

}
